# -*- coding: utf-8 *-*
from graphs.listgraph import *


def add_edge(g, src, dest):
    g.add_edge(src, dest, 1)
    g.add_edge(dest, src, 1)


def generate_test1():

    graph = ListGraph()

    graph.add_vertex('A')
    graph.add_vertex('B')
    graph.add_vertex('C')
    graph.add_vertex('D')
    graph.add_vertex('E')
    graph.add_vertex('F')
    graph.add_vertex('G')

    add_edge(graph, 'A', 'B')
    add_edge(graph, 'A', 'C')
    add_edge(graph, 'A', 'D')
    add_edge(graph, 'B', 'E')
    add_edge(graph, 'C', 'F')
    add_edge(graph, 'F', 'G')

    graph.save('inputs/test1.txt')


def generate_test2():
    graph = ListGraph()

    graph.add_vertex('A')
    graph.add_vertex('B')
    graph.add_vertex('C')
    graph.add_vertex('D')

    add_edge(graph, 'A', 'B')
    add_edge(graph, 'A', 'C')
    add_edge(graph, 'A', 'D')
    add_edge(graph, 'B', 'C')
    add_edge(graph, 'B', 'D')
    add_edge(graph, 'C', 'D')

    graph.save('inputs/test2.txt')


def generate_test3():
    graph = ListGraph()

    graph.add_vertex('A')
    graph.add_vertex('B')
    graph.add_vertex('C')
    graph.add_vertex('D')

    add_edge(graph, 'B', 'C')
    add_edge(graph, 'B', 'D')
    add_edge(graph, 'C', 'D')

    graph.save('inputs/test3.txt')


def generate_test4():
    graph = ListGraph()

    graph.add_vertex('A')
    graph.add_vertex('B')
    graph.add_vertex('C')
    graph.add_vertex('D')

    add_edge(graph, 'A', 'B')
    add_edge(graph, 'B', 'C')
    add_edge(graph, 'C', 'D')

    graph.save('inputs/test4.txt')

generate_test1()
generate_test2()
generate_test3()
generate_test4()
